<template>
    <fieldset>
        <legend>container组件</legend>
        <div id="container">
        <modal :visible="visible" @on-cancel="cancel"
        @on-confirm="confirm"></modal>
        <button @click="showModal">点击显示模态框</button>
    </div>
    </fieldset>
</template>

<script>
import modal from "./container.vue"
// import reuse from "./reuse.vue"

export default {
    data(){
        return {
            visible:false,
        }
    },
    methods:{
        showModal(){
            this.visible = true;
        },
        cancel(){
            this.visible = false;
            alert("已取消")
        },
        confirm(){
            this.visible = false;
            alert("已成功")
        }
    },
    components:{
        modal,
    }
}
</script>